package com.usian.feign;

import com.usian.pojo.TbContentCategory;
import com.usian.utils.AdNode;
import com.usian.utils.PageResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Author lpf
 * @Date 2022/3/24 上午10:56
 * @ProjectName java134-e-commerce-project
 * @Version 1.0
 * @Description:
 */
@FeignClient(value = "usian-content-service")
public interface ContentServiceFeign {

    @RequestMapping(value = "service/contentCategory/selectContentCategoryByParentId")
    List<TbContentCategory> selectContentCategoryByParentId(@RequestParam("id") Long id);

    @RequestMapping(value = "service/contentCategory/insertContentCategory", method = RequestMethod.POST)
    Integer insertContentCategory(@RequestBody TbContentCategory tbContentCategory);

    @RequestMapping(value = "service/content/selectTbContentAllByCategoryId")
    PageResult selectTbContentAllByCategoryId(@RequestParam Integer rows, @RequestParam Integer pages, @RequestParam Long categoryId);


    /**
     * 根据id删除内容管理
     * @param categoryId
     * @return
     * @Auth fgg
     */
    @RequestMapping(value = "service/contentCategory/deleteContentCategoryById",method = RequestMethod.POST)
    int deleteContentCategoryById(@RequestParam Long categoryId);

    @RequestMapping("service/content/selectFrontendContentByAD")
    List<AdNode> selectFrontendContentByAD();
}
